package com.inspur.gs.sbssdl.sbssgl.sbtz.sbtz.back.commoncmps;

import com.inspur.edp.dxc.common.domain.CommonResult;
import com.inspur.edp.dxc.spi.components.BaseAfterDBUpdateComponent;
import com.inspur.edp.qdp.bql.api.IBqlExecuter;
import com.inspur.edp.qdp.bql.api.OptionType;
import io.iec.edp.caf.runtime.config.BqlBeanUtil;

import java.util.ArrayList;

public class SbssSbtzImportAfter extends BaseAfterDBUpdateComponent {

    private final IBqlExecuter bqlExecuter = BqlBeanUtil.getAppCtx().getBean(IBqlExecuter.class);
    public void clearData(){
        String sql = "delete from SBSS_SBTZ_SBTZ where SBBH IS NULL";

        bqlExecuter.getOptions().setOptionType(OptionType.ExecuteSql);

        int i = bqlExecuter.executeBqlStatement(sql, new ArrayList<>());

        CommonResult result = super.getResult();
        result.setSuccess(true);
    }
}